home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / MouseInfo / MMouseInfo.cp < prev    next >
Encoding:
Text File  |  1994-11-14  |  1.6 KB  |  59 lines  |  [TEXT/MPS ]

  1. //     MMouseInfo.cp
  2. //     Copyright © 1992 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This is the main-main file, it all starts here...
  5. //    Version Info (latest first):
  6. //
  7. //    <1>        khs        1.0        First final version
  8. //    <2>        khs        1.0.1    Fixed a memory leak in TMapApplication::GetSleepValue()
  9.  
  10.  
  11. // INCLUDES
  12. #ifndef __MOUSEINFO__
  13. #include "UMouseInfo.h"
  14. #endif
  15.  
  16. #ifndef __UMENUEDWINDOW__
  17. #include "UMenuedWindow.h"
  18. #endif
  19.  
  20. #ifndef __MOUSETRACKBEHAVIOR__
  21. #include "UMouseTrackBehavior.h"
  22. #endif
  23.  
  24.  
  25. // T H E   M A I N    P R O G R A M
  26.  
  27. TMapApplication* gMapApplication = NULL;        // the application object 
  28. RgnHandle gtempRgn;                                // used for sleep region calculations
  29.  
  30.  
  31. void main()
  32. {
  33.     InitToolBox();                                // essential toolbox and utilities initialization
  34.  
  35.     // make sure we can run
  36.     if (ValidateConfiguration(gConfiguration) && gConfiguration.hasColorQD)
  37.     {
  38.         // we made it! Continue with remainder of initialization 
  39.         gtempRgn = MakeNewRgn();                // create the region needed for sleep region calcs
  40.  
  41.         InitUMacApp(8);                            // initialize MacApp; 8 calls to MoreMasters
  42.         InitUDialog();                            // initialize the TDialog view handling
  43.         InitUFloatWindow();                        // initialize floating window units
  44.  
  45.         // construct a new TMapApplication object, allocation errors are checked for.
  46.         gMapApplication = new TMapApplication;
  47.         gMapApplication->IMapApplication(kFileType, kSignature);
  48.  
  49.         InitUMenuedWindow(mWindows);            // initialize UMenuedWindow Behavior module
  50.         InitMouseTrackBehavior();                // initialize Mouse Tracking behavior module
  51.  
  52.         gMapApplication->Run();                    // run the application, when it's done - exit.
  53.     }
  54.     else
  55.         StdAlert(phUnsupportedConfiguration);
  56. }
  57.  
  58.  
  59.